A key aspect of brain function is how the activity of neuronal populations encodes information that is used to guide behavior. A longstanding model system to understand population coding is the visual cerebral cortex, because its structure and anatomy are well understood, and because visual stimuli can be presented to subjects with high levels of temporal and spatial control. Thousands or more neurons fire action potentials in response to a single visual stimulus, and an important open question is how this population response carries information - how the detailed timing and pattern of these spikes across neurons is decoded to guide behavior. Because it is known that genetics controls the identity and morphology of neurons, and influences which other neurons they form synaptic partners with, it appears likely that the precise details of which neurons in a population fire spikes is vitally important for behavior. But surprisingly, past experimental work hints that the primary quantity governing neuronal coding is the total number of spikes or average firing rate across a population, making the precise timing and spatial distribution of those spikes less important. Theoretical work shows that either type of code can be supported by the cortex and that the type of code used may even vary from one behavioral task to the next. However, it has not been possible to definitively determine how cortical population codes are used for behavior because of the inability to change the activity of neurons in a patterned fashion. In this project, we will use two-photon ontogenetic stimulation to activate patterns of neurons in behaving animals to understand the details of how population codes control behavior. This work is made possible by the combination of optical wave front-shaping methods to control the size and shape of a two- photon optical focal volume, and psychophysical behavioral methods in mice that allow precise quantification of animals' perceptual performance when neuronal patterns are stimulated. We will use two-photon patterned stimulation to replay naturally-occurring population responses to determine if they have special meaning to the animal, perhaps because those patterns are determined by essential synaptic connections. By using patterned stimulation to vary the activity correlation between neurons, we will also test whether previously-observed pairwise correlations, which measure the relationship between the firing activities of two neurons, are an important part of the neuronal code. In achieving our goals we will produce a new technology for stimulating neurons in the brains of behaving animals with single-cell specificity that can be adapted to explore neuronal dynamics in a wide range of animal models and behaviors.